package com.ztorn.common.pool;

public class ConsolePool extends AbstractPool<String, StringBuilder> {

    public static final ConsolePool INSTANCE = new ConsolePool();

    public static void write(String str, Integer userId) {
        String user = String.valueOf(userId);
        INSTANCE.computeIfAbsent(user, k -> new StringBuilder("Ztorn User Console:")).append(str);
    }

    public static void clear(Integer userId) {
        String user = String.valueOf(userId);
        INSTANCE.put(user, new StringBuilder("Ztorn User Console:"));
    }
}
